package hfu.pm.domain;

import hfu.pm.entities.Account;
import hfu.pm.entities.Contact;
import hfu.pm.entities.Invitation;
import hfu.pm.entities.Message;
import hfu.pm.entities.Room;
import hfu.pm.entities.Subscription;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.ObjectifyOpts;
import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.util.DAOBase;

public class DAO extends DAOBase {
	static {
		ObjectifyService.register(Account.class);
		ObjectifyService.register(Message.class);
		ObjectifyService.register(Room.class);
		ObjectifyService.register(Contact.class);
		ObjectifyService.register(Subscription.class);
		ObjectifyService.register(Invitation.class);
	}
	
	public <T> T get(Key<T> key) {
		return ofy().get(key);
	}
	
	public <T> T get(String key) {
		return ofy().get(new Key<T>(key));
	}
	
	public DAO() {
		super();
	}
	
	public DAO(ObjectifyOpts opts) {
		super(opts);
	}
}
